package com.wbt.spring.support.service;


import com.wbt.common.beans.User;
import com.wbt.spring.support.dao.UsersDao;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class UsersService implements InitializingBean {

    @Autowired
    private UsersDao userDao;

    public User getUser(){
        return userDao.getUser();
    }

    public List<User> getListUser(){
        return userDao.getUserList();
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("UserService running afterPropertiesSet ... ... ");
    }
}
